/* Copyright (c) 2011-2021 Columbia University, System Level Design Group */
/* SPDX-License-Identifier: Apache-2.0 */

#ifndef SHA2_TESTS_H
#define SHA2_TESTS_H

#define N_TESTS 12

static unsigned sha2_raw_in_bytes[N_TESTS] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 64, 6400};
static unsigned sha2_raw_out_bytes[N_TESTS] = {28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28};

static unsigned sha2_raw_in_words[N_TESTS] = {0, 2, 2, 2, 2, 2, 2, 2, 2, 4, 16, 1600};
static unsigned sha2_raw_out_words[N_TESTS] = {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8};

static unsigned sha2_raw_inputs[N_TESTS][1600] = {
    {0x00000000, 0x00000000}, // 0, SHA224ShortMsg.rsp
    {0x84000000, 0x00000000},
    {0x5c7b0000, 0x00000000},
    {0x51ca3d00, 0x00000000},
    {0x6084347e, 0x00000000},
    {0x493e1462, 0x3c000000},
    {0xd729d8cd, 0x16310000},
    {0xcbf2061e, 0x10faa500},
    {0x5f77b366, 0x4823c33e},
    {0x10713b89, 0x4de4a734, 0xc0000000, 0x00000000}, // 72, SHA224ShortMsg.rsp
    {0xa3310ba0, 0x64be2e14, 0xad32276e, 0x18cd0310, 0xc933a6e6, 0x50c3c754, 0xd0243c6c, 0x61207865,
     0xb4b65248, 0xf66a08ed, 0xf6e08326, 0x89a9dc3a, 0x2e5d2095, 0xeeea50bd, 0x862bac88, 0xc8bd318d}, // 512, SHA224ShortMsg.rsp
    {0xf61363ea, 0xa08cce68, 0x283076fa, 0x1ba17ffe, 0xeade05f8, 0x9e216891, 0xc703e7e0, 0xb5e671e9, // 51200, SHA224LongMsg.rsp
     0xeb94b763, 0xd12486bf, 0xa91e5465, 0xc4df1941, 0xf63e607e, 0x476f9d91, 0xeb28c17a, 0x75030c46, 
     0x472422d9, 0x4d1b62ea, 0xeb0b734f, 0x330c1f7b, 0x5ccf6545, 0x6f81c9eb, 0x44f1ef56, 0xadf4689f, 
     0xf109ccd3, 0x7c3909f3, 0xd441fa3f, 0xcff33cb4, 0x04da3dd4, 0x7f1d95a5, 0xb9a59afc, 0xc7822efb, 
     0xd18bdcd9, 0xc64524e1, 0x4e0712be, 0x005b16f5, 0xd6a60fb3, 0xdd0ca9c9, 0x318ee9f5, 0x29750663, 
     0xcff47b73, 0x93095abd, 0x40a4e353, 0x2e0b5545, 0xba7d046b, 0xf315ac5e, 0x96f205c8, 0x3d9597de, 
     0xd38ad02a, 0x4b4b548e, 0x91619486, 0xc1cca2ad, 0x98a54483, 0x2802476d, 0xcf1a15fd, 0x69aa8a74, 
     0xc5970485, 0x56d4b95c, 0x2b864edf, 0x2166a534, 0x5867f683, 0xe39a21fd, 0xc44e421d, 0x177b862d, 
     0x8d613e0d, 0x1c6c3230, 0xf55b38e7, 0xb7a105e2, 0xe20b42f3, 0x8ea4e316, 0x5dd6b4af, 0xaed13412, 
     0x1331a748, 0x06da6711, 0xd7277b25, 0xe9456abf, 0x1ed9515c, 0x90e934c0, 0x82f9923b, 0x96743c2a, 
     0x404e67c0, 0x7ae8ff07, 0xb9343e21, 0x20197ed4, 0xf4194b46, 0x5131bd04, 0x1b000449, 0x362c457e, 
     0xfa02a5fd, 0xe15ca31a, 0x83c8aa64, 0xc5e6e628, 0x4d125837, 0x394325e9, 0x10333462, 0xf8c1f714, 
     0x2a938985, 0xa4fffa53, 0x1d2ce775, 0x3e744dc3, 0x0f0d9eb9, 0xb0e91578, 0x49da470d, 0x43fafcf6, 
     0xb94a3ce2, 0x2999adb9, 0x70a81cdc, 0xf58b59ae, 0x24524853, 0x1ee935b8, 0xae3d68d3, 0x80a0f92c, 
     0x8d6fe69c, 0xdaf26354, 0x62837122, 0x50f3b2f0, 0x72297c8e, 0xeb0c2cb1, 0x28a4bd3b, 0x157b99bc, 
     0x904aae39, 0x1ed1c52d, 0xdc070fce, 0xb9730191, 0xe3da62f0, 0x7f1aa36b, 0x9d566ecd, 0x6b5381b0, 
     0xa822bd43, 0x5c007a4b, 0xc77a1e68, 0x97d5ee9a, 0x5eac2403, 0x42db41ef, 0xf79ca411, 0xeaf05c0f, 
     0xbf413b42, 0xfe452bb7, 0x0925c579, 0x52df2012, 0xcae9e74f, 0x9d17af44, 0x1cbe8790, 0xfa1ad0e2, 
     0xbced4fbc, 0x6b698077, 0x8c502d88, 0x525a4001, 0x11d7d65b, 0xf6959472, 0xf6043ed1, 0x04988530, 
     0x876f213b, 0x0b342095, 0x36437e1d, 0xfe0df570, 0x1abe16af, 0xb61e9982, 0x6bb5f25c, 0x6e332501, 
     0x080fda46, 0x466db418, 0xf145dfc0, 0xc0c2e865, 0xcde8d2d3, 0x467a667b, 0x651bcaba, 0xa2b3555e, 
     0x2714a266, 0x84dee309, 0xa49f78fa, 0xff3fc1eb, 0x129c3050, 0x0c71a265, 0xcb7cef72, 0x06e0bf4d, 
     0xccc8a021, 0x2d4d566f, 0x379a7252, 0x244d2707, 0xd12158ac, 0x72caf548, 0x8521880c, 0x04810bd9, 
     0xdf71fd02, 0xa983b552, 0x917cf551, 0x95b4c2c3, 0xf2c07372, 0xdf4f092d, 0x7a52be11, 0x0360e107, 
     0x4858e08e, 0x6048a7bb, 0x9c8d287d, 0xbb3c3b26, 0x5dc1a927, 0xbbc6831b, 0x9457b908, 0x6b43e7e1, 
     0xefc5724f, 0xbb63d4b0, 0x3f173461, 0xfead3a38, 0xfb6c2155, 0x6df80e1b, 0xba77a079, 0xa3f3c86e, 
     0xbcffdbcc, 0x209ee53c, 0x62604182, 0xc7ce6602, 0xb2080483, 0x5fad5034, 0xd4fb9bec, 0x15382ab6, 
     0x9850428d, 0xf8bf8264, 0xedb1766a, 0x7c68688b, 0x6bdf793a, 0xf8adf16e, 0xcb2bd4ea, 0x28d9b6c2, 
     0x69fecf1b, 0xac8f5232, 0xc952fba0, 0x8743e7dc, 0x0f37a901, 0xa0bf9ad1, 0x854f70fa, 0x44a01399, 
     0x1952acfd, 0xa2d6fead, 0xdc8bf9ac, 0x4e278cfb, 0x8459bc60, 0xbfadf366, 0xebaf9aa5, 0xd153e943, 
     0x8e94febb, 0x445c2ddd, 0x0fa49817, 0x3bdcfff2, 0xb48dd9df, 0xbd3da334, 0xe5937872, 0x37bbe2c9, 
     0xb20cf0de, 0xf9e888cb, 0x4be4ff67, 0xb429e7c9, 0x851b2807, 0x03385343, 0x5c4232e9, 0xdfa0a432, 
     0x6b02a7ed, 0x2844b77e, 0x76955727, 0x23d8ed86, 0xe14ad25f, 0xf765aa9c, 0x3605f192, 0x2fcad786, 
     0xa3bd4e70, 0x3b3661fe, 0x79fdc7dc, 0xefafb833, 0xaf63ff70, 0x028e5146, 0x5d24ddf6, 0x900024ce, 
     0x41860bef, 0x99872e54, 0x3d647810, 0x8077f1d7, 0xd7aed6c0, 0x8d79ef49, 0xb7e71d9c, 0x6b0c3311, 
     0x2da506f3, 0xaaffc887, 0xa914914a, 0x3ef73f7b, 0x407380d9, 0xfeef2dae, 0x2e95da0c, 0x26b4ab57, 
     0x4f626903, 0xd665d49f, 0xa4543b13, 0x91f94b26, 0xd4fa2543, 0xbeb8b37c, 0xa9783bcf, 0x2bc134a8, 
     0x8f0459a8, 0x8583fda5, 0x186b9ef2, 0xe143bce0, 0x7a8aeb84, 0x369c28bb, 0x0fd6696c, 0xe0fa780d, 
     0xd5d50069, 0x1f1fe8a0, 0xeca2e16f, 0x969f3bb1, 0x1a6dfd26, 0xcd633474, 0x4af88b6b, 0xaf291c8d, 
     0x091b86ce, 0x0c024098, 0x08412d12, 0x18d370a2, 0x9de981b1, 0xead480ae, 0x4126ca55, 0xff14cb31, 
     0x131f135f, 0xb4f4ab96, 0x5490a964, 0xcfa702ba, 0xe947a0ab, 0xf7b9b471, 0xdca84eb1, 0x37842b00, 
     0xdb29cda5, 0x80bcd1a0, 0xb8d67eec, 0x24e59a02, 0xe7cf819e, 0x5bd878c5, 0x03c53e07, 0xc141e402, 
     0x4981df27, 0xd6245cc1, 0x1c5dd332, 0x7d53df80, 0x7fc84d11, 0x7ef972b3, 0x9ec6c2e0, 0x04139f3f, 
     0x466e6f6d, 0x1ff2f1fe, 0x686bd1bf, 0x43bb7a3e, 0x9a7c2b8d, 0xc8e64d42, 0x95f304c2, 0x68c204c0, 
     0xb839a600, 0xc4ef3a61, 0x84499f1a, 0xdfe31244, 0x1e314499, 0xa166af7b, 0xd0942938, 0x5515ba8c, 
     0x892bab67, 0x2be3dff1, 0x583f67cb, 0xb7935098, 0xf530bfbd, 0x71404164, 0x38f15cc7, 0x33d66aab, 
     0x9f8aa72a, 0xbe9688b6, 0xcc944e5b, 0x3595dc44, 0x05c1c581, 0xa03daa08, 0xb352c3f9, 0x6acbbb26, 
     0xe49ec1d2, 0xe4cfdcb9, 0xc9927e51, 0xc0b05d50, 0x382b7e6e, 0x9625926c, 0x2afe8655, 0x62bd5604, 
     0x3eb122e6, 0x04588301, 0x357f1f35, 0xbfab7bc2, 0x74b8110b, 0xbbc0a39a, 0x863ece63, 0x8473e24d, 
     0x9709f1ee, 0x88f72696, 0xfaa45890, 0x9c4fdfa4, 0xa3aea7e0, 0x78d58399, 0xad5ac3ac, 0x36b70809, 
     0xd6ef5773, 0xd7756d81, 0xfe4952e9, 0xbe6431fd, 0xac566776, 0x332eda71, 0x899a8cb7, 0xe14f7041, 
     0xe3ab7cfc, 0x5999ffc9, 0x2bb635c8, 0x8db218d6, 0x77f87a54, 0x5591512b, 0x0145520c, 0xee04c1fd, 
     0xa6858711, 0x762d8576, 0x673228b5, 0x71003d36, 0xecdc0703, 0x47c78fcd, 0xfca53c34, 0xc39ea343, 
     0x07c5a03a, 0x96f7a691, 0x9c065339, 0xd2174825, 0xf3493709, 0x70983d62, 0x640073b6, 0xcae5c01d, 
     0xeeb2f100, 0x21c10b21, 0xb17bdfdb, 0x18c0e0ac, 0x748932f0, 0x37cb03ef, 0x209f1e1a, 0x6aa1bd92, 
     0x43959fea, 0x7f515b2e, 0x8ed7f424, 0xabc1add1, 0x57e21f3f, 0x062a887e, 0x18ca66e9, 0x0a9945aa, 
     0xeeb6d581, 0x186f3fc1, 0x1b62b99b, 0xf4e2599e, 0x849d267f, 0x447b7516, 0x34c973aa, 0x1496fe6e, 
     0xd75db94b, 0x55e55fe0, 0x406657c8, 0x59ed891b, 0xe3017137, 0x588771c0, 0x5ce36ce5, 0xef6090e5, 
     0xe6d273d2, 0x9c7a6296, 0xe529f633, 0x43a8e74f, 0x5d5825ef, 0xac162583, 0x78617923, 0x03bfa418, 
     0x045c2c9e, 0x56f5f1e8, 0xf2f4bc65, 0x1bdd1b42, 0xd8e86d30, 0xa7f03967, 0x708bc4ea, 0xb87be20d, 
     0x17450c35, 0xec1fb3e0, 0x4f0fd4e5, 0x4752cdfc, 0x3dfb6f80, 0xb1dc5474, 0x2ca972c5, 0x765bf1ce, 
     0x08d33a21, 0xc4c05185, 0xe4c2643b, 0x31d0a486, 0x75d7536a, 0x32a31eb3, 0x9403ae39, 0xa5287a63, 
     0xc04fdfea, 0x48a072df, 0x995595f0, 0x3f1e48e7, 0x67c44273, 0x920d412b, 0x91e19ed0, 0xadaa24d2, 
     0x26012216, 0xdf86bff7, 0x570f8e8b, 0xdb066227, 0xfa0c6425, 0x3ae262e4, 0x098a6a11, 0xf6a99825, 
     0x21302c2f, 0xf03bdfd4, 0x043a7894, 0x6c4e9a4f, 0x18f6e007, 0x90ea2ce7, 0xe6473b84, 0xe8ed7d64, 
     0x9b2524bd, 0xe5887b7e, 0x8a1c7a93, 0x5abf9765, 0xa8c9dea1, 0xfded443b, 0x0e6039b2, 0xec3d7c95, 
     0x7b293346, 0x25333bfe, 0xcffdbd11, 0x0c210274, 0x91ce887c, 0xeab255e8, 0x6b1d8b22, 0x68633dc2, 
     0xa9828154, 0x1804c65b, 0xbd276896, 0xec3c8281, 0xbd4d041f, 0xbd0205f7, 0xe3c55a5c, 0xc62567f2, 
     0x0c78356e, 0x26c5c59d, 0x3be1a4a8, 0x61d7c096, 0x138d7a12, 0xe0a5fc6f, 0x60a2cde9, 0x6c4ca22e, 
     0x8e55781d, 0xb73cdfcd, 0x307299d1, 0xd3bc63ba, 0x7bd813de, 0xb963e358, 0xc9fa0d50, 0xc4a0987d, 
     0x165f71e7, 0x3332bdf2, 0x86236e98, 0xaab114f6, 0xdd74f60a, 0xb20462bb, 0x06164119, 0x34e8eee7, 
     0x8de04957, 0x02700714, 0x243c4c85, 0x4f7f7b51, 0x21aa4d1e, 0x314f209f, 0xfe3e92cd, 0x26ee4f74, 
     0xd91e27f2, 0x8cbb643b, 0xf2055a21, 0x28ee3fd3, 0x30c23da3, 0xa00dc60c, 0x9bba28f3, 0x0178612d, 
     0xe3623442, 0x3ade7c70, 0xd8c5c1f3, 0x9ec50984, 0xf004f020, 0x6606fb0a, 0xc4d12a13, 0x2d4fcc19, 
     0x93f397ce, 0x729ff8ba, 0xbec6a884, 0x1ace806d, 0x4ab88e1d, 0xeb0268a2, 0x61ccc0b6, 0x123b3940, 
     0xd21b791e, 0x9dc88022, 0x8c4e385a, 0x02cf4d95, 0x26253e22, 0x97c9b5db, 0x5bf31463, 0x180350ab, 
     0x862002bb, 0x241fbbaf, 0x2aa698ff, 0xbf911704, 0x6d9429b8, 0xd22289be, 0x988e4ba2, 0xa771b861, 
     0x984b592c, 0x6d6d5269, 0x8016f2fb, 0xbadc87c3, 0x054d7766, 0x04d78c51, 0x01e590fb, 0x274b1a6a, 
     0xf1e4a7f9, 0xe279ec58, 0x77e56bd4, 0x5a7745d9, 0xd8984fb5, 0x95ae679e, 0x7e4009f7, 0x005a1dcf, 
     0x773313ab, 0xea0d3285, 0xf55d2d14, 0x062cf84e, 0xcdbdd92c, 0xed70c2ad, 0xf8e6de1d, 0x9a666a97, 
     0x147fc6c9, 0xecefccf7, 0xe3c46042, 0x28c1482b, 0xcb033f53, 0x74e54484, 0x552038f5, 0x5d37a8ca, 
     0xaf12e8db, 0x52e861b6, 0x2a632be7, 0x27ffdf77, 0xbcb4a6b2, 0x93d4962d, 0x7f363f08, 0xb2948071, 
     0x3032a069, 0x83c099cb, 0xb082b78a, 0x6bae623a, 0x871638d2, 0xb00660b0, 0x5c701add, 0xff469a93, 
     0x7e2816fc, 0xe73f1e3d, 0x5f692cb3, 0x5c967c7c, 0x14721d3a, 0x35444913, 0xd615f2fd, 0xad169d38, 
     0x833c731b, 0xe62d9514, 0x1e5fb1eb, 0x627ed346, 0x4b0f7d72, 0x8854f960, 0xd46feeee, 0x25c93268, 
     0x26b5df4f, 0xe851a959, 0xd4ad6eb8, 0xe5300f9f, 0x14377f03, 0x13fe199f, 0x3dc4373a, 0xce2a002c, 
     0x4fdd811f, 0x55740013, 0x6b9c8ca5, 0x4d72d990, 0x57304b74, 0x3c0c51d6, 0xfb5df468, 0x0f00b08b, 
     0xe6fa8213, 0x955e424a, 0xca723337, 0x020dd920, 0xfc430a4d, 0x6d44480f, 0xf5824e01, 0x5212e98e, 
     0xd45509b3, 0x10d71806, 0xd9778af8, 0x6cc9b657, 0xebb8e417, 0x0d70a751, 0x137b6d8c, 0xfe29543c, 
     0xff363f88, 0x2fa72a50, 0x80f5ba6f, 0xf36d183d, 0x0cd70058, 0x845615a5, 0x3d8f7891, 0x7b0d989d, 
     0x50e44c19, 0x58951f2f, 0xa732ea24, 0x00c3a9db, 0x47e7879b, 0x39bf3b11, 0x5b079799, 0x30865eb9, 
     0xafa957ee, 0xf46b9fac, 0x367743a0, 0xf9910e38, 0x8532a065, 0x9672c0a0, 0x552bf42b, 0x875c4e99, 
     0x05cb8890, 0x6cef54ce, 0x150ced6a, 0x48a0f25c, 0xacfe7440, 0x02394e57, 0x1343b4cf, 0xe7560f44, 
     0x38930886, 0x26eae39d, 0x2d390f0a, 0x53b8fb50, 0xa6942bb3, 0xe5da8a40, 0x7e97020d, 0xb83e4ac2, 
     0x3249ff58, 0x8c23f721, 0x6446d209, 0x84a0d11b, 0x593cec47, 0xa81e1e62, 0x7c6f046e, 0x63daa61c, 
     0xd935958f, 0x05643663, 0xa37a5dee, 0x42221dc5, 0xaf3edf82, 0xb1cdb2c5, 0xf612e279, 0x4ef3cc59, 
     0x179ff0b2, 0xf873486a, 0xd31fd941, 0xf4048757, 0x8fe12def, 0x69afed72, 0xd5c9c5b7, 0xe2506381, 
     0xd3ce3b49, 0xcf19d63e, 0xda7b6d8b, 0x040fb6d8, 0xe06efe13, 0x388b7870, 0xffdcd5ae, 0x87bb149d, 
     0xf50b9cdd, 0xf11e88e8, 0xa2d64252, 0xd90b5350, 0x8c2d7978, 0x872bfac7, 0x5e9339e8, 0xa6fa87b3, 
     0x649e3bf5, 0xc64a056f, 0x117a7f21, 0xdbc005c8, 0x7a66c7a5, 0xbc551c80, 0xd9351aed, 0xa5d663ce, 
     0x0acf4119, 0xb665f6db, 0x11ae4d7d, 0x72f67546, 0x92610f22, 0x41d286a2, 0x570c9f43, 0xee1751f3, 
     0xcee6d6d1, 0x29360235, 0x89b9d4f0, 0x06744bd5, 0xbc657a78, 0x7c6adf35, 0xc25ef174, 0xe785f82c, 
     0x982a21a6, 0x8786d284, 0x60e43b01, 0xff032e7a, 0xe0bc302e, 0xd7e4d042, 0x01743708, 0xfae70180, 
     0x50e44b1f, 0x381d0dd0, 0x8077ab39, 0xc56bc63f, 0xe6ac58cc, 0xb80a00cf, 0xfc969a85, 0x8e0713f8, 
     0xdf5c7bc5, 0xa4c35c21, 0xd0ba4b1e, 0xc074bc2b, 0xb67e1bda, 0x89a218e7, 0x9b0c4275, 0x0aabd79a, 
     0x2bdada1e, 0x34406780, 0x38f4443a, 0x59e5b846, 0x397aa0e1, 0xb175bf8f, 0xc61d565f, 0xd89cf470, 
     0x1da690b4, 0x4e5bd5f4, 0xa06fbd15, 0xf6886199, 0x55e71069, 0x984b9ed1, 0x6512fecc, 0x5fa21382, 
     0x9d07c40f, 0x5cdd4f86, 0xf071df35, 0x0123602b, 0xf30f92f8, 0xa6ec5cb4, 0x60336443, 0x0784dcd6, 
     0x94479fb5, 0xc48f7c3d, 0x1043d124, 0xe07f5c05, 0xfc384f18, 0x431fa240, 0x9fc8ad4c, 0x380cf676, 
     0xe8ac4830, 0xf0360521, 0xe92dbc6a, 0xfd64fe2d, 0x56ab6e50, 0xd7ad187e, 0x0a19046f, 0x5a000a6a, 
     0x837fe708, 0x469d913a, 0x6176c88d, 0xbe9aeead, 0xebb01828, 0xca5f6575, 0x8a6e8f35, 0xd529bfb8, 
     0x4b07a6c3, 0x308bc991, 0x61681c17, 0x8de8d38d, 0xa18e7529, 0x84fb322e, 0x050e7625, 0x124fbe6a, 
     0x2a8eabeb, 0x14c7542d, 0xd249e190, 0xd11756d3, 0x628facda, 0x6e4926af, 0x6442e2c8, 0x773aaf88, 
     0x075a1e07, 0x5c1adc16, 0x9a623e7e, 0xf1ef1e89, 0x15f9e6c4, 0xee13ea02, 0x9052fba4, 0x6db13818, 
     0xc9b428a0, 0x6f4c0655, 0xa3fb5c6b, 0x5738d4b6, 0xa2154a6d, 0x6d1f252f, 0x7086e843, 0x5d7e0424, 
     0x5ae4f13d, 0xb5257cf1, 0xd35c63de, 0x6aba1f63, 0xf02b015f, 0x5436803c, 0xeb25d22d, 0xad67b9b3, 
     0xa132a066, 0x966de6f2, 0x14cc7a60, 0x923da897, 0xe9833222, 0x0920a333, 0xeb79e0e8, 0xc73500ce, 
     0x86e65da4, 0x7aebeb61, 0x4d95c978, 0x3788165a, 0x7464063c, 0xf6a5351b, 0x57c83bfe, 0x11b0807c, 
     0xf147527d, 0xc9683445, 0x66fd79ae, 0xc16412b4, 0x7918a537, 0x818ddffd, 0x165b0af7, 0xf59fe2c5, 
     0xca9ea47b, 0xebac69a6, 0x464db28a, 0x999944ae, 0xe1e5369b, 0x149f48e0, 0x127a7659, 0xd9cbcdb1, 
     0xf9337e26, 0x497f318c, 0xd7cc9b95, 0x25ef534f, 0x9214e1ee, 0x16a418cc, 0x326da7ae, 0x27fdea49, 
     0x674e0605, 0x49a93400, 0x00c45d56, 0xce2ee8a0, 0x75ecd0ba, 0xef65f9ca, 0x5e7bc47d, 0x46fbe194, 
     0xfa3764a0, 0x54f11b09, 0xa97b1f55, 0xfc1daaa7, 0x72b72886, 0x06a791e0, 0x7eedf54f, 0x9e8d599a, 
     0x9b35c17f, 0xd3208eb0, 0xba3a0a1b, 0x1885426e, 0x72bb14db, 0xc5358819, 0x7b0b64ab, 0x977dfa64, 
     0x3392452b, 0x2cfe34fc, 0x1c49462f, 0x882e57fd, 0x5b42ba40, 0x93d6877a, 0x3b1d3619, 0x99926df9, 
     0xa894172b, 0xc953b6f5, 0xb5f0fa19, 0xb6e0925a, 0x1792423d, 0xd851360d, 0xa76b9621, 0x0c935a62, 
     0xe4846007, 0x10e7bba3, 0x6e774f62, 0x08639b8f, 0x8cf3d55a, 0xfd6f3cd9, 0xa73daa4c, 0x584968a5, 
     0xcdaa4748, 0x6b82ec0f, 0x30256c91, 0xe87e19a4, 0xa4af9b20, 0x68f842e6, 0x24da9a21, 0xe57c40cc, 
     0x4d4df575, 0x41ebf140, 0xe144792e, 0xbdfbb49f, 0x450dbb16, 0x82b4ef3d, 0x048b8f29, 0x1cf38ade, 
     0x4bb69116, 0xf9eb713e, 0x6a1aa0c2, 0xefa0158a, 0x59545dc5, 0xb36aece5, 0x3198b1ea, 0x6378ede4, 
     0xae2e44b3, 0xfd4a1512, 0xb4f007d4, 0xe636e46c, 0xc7cdabb3, 0x64e4e0e6, 0x914927ee, 0x23d111e5, 
     0x60fb36d5, 0xb4d084c3, 0xa60dd6ec, 0x0984c84e, 0x77c0ca6a, 0xfbe87449, 0x0ee51abd, 0xc5c79fe9, 
     0x48658e03, 0x86446659, 0x27bb3692, 0xc2546a37, 0x5174e572, 0xe23f5015, 0x8fb6b1dd, 0xaf223ff9, 
     0x4eb675c6, 0xdb7065dd, 0x21404f4f, 0x796c722f, 0x3d332251, 0x7fb11b52, 0xfb0215d8, 0x4baa981b, 
     0x5a3412a5, 0x1b1a2756, 0x7be548aa, 0x9495873f, 0x2343a991, 0x3c057d08, 0x3c126d36, 0x00275359, 
     0x54298e28, 0xae0b54cc, 0x1df2492c, 0x7c97516d, 0xebeda3b9, 0x80052040, 0x392ee27d, 0x356017bb, 
     0x24db10d7, 0xfd0b9547, 0xefaf7c5b, 0x993a7ac3, 0x7d793852, 0xb277a902, 0xda9e9c37, 0x541e8d48, 
     0xb393c13b, 0x6ee292d0, 0xd86307c2, 0x5346a749, 0xc12f8fe3, 0x3c24c354, 0x07a9c2eb, 0xc4295d08, 
     0xe798c8db, 0x6a57f26e, 0xc35812e6, 0x13828206, 0xa057d1f4, 0x85d41440, 0xa8987c22, 0xed492e03, 
     0xa9344e3f, 0x5a335d2a, 0x95d4c651, 0x3fb7b302, 0x0038250e, 0xf54e44cd, 0xa5b3f463, 0x3746a842, 
     0xe2ad7bf0, 0xa43e7d0b, 0x37204a8a, 0x41ade245, 0xcb1bb4b8, 0xf45cfc03, 0xe6424f36, 0x0ae774cc, 
     0x784c7675, 0xb240f719, 0x9184c719, 0x7f2cb6d8, 0xe748a67a, 0xeac4e4eb, 0x548db823, 0xcef53aa9, 
     0x55596856, 0xea01765c, 0x8b476587, 0x63fcd7c2, 0x3e0722dc, 0x3f4fa38c, 0xd5dc55b3, 0xeb39a1e2, 
     0x5f1c781c, 0xb648a0dd, 0x0eb34b5a, 0x53e4ee0b, 0xb6a05067, 0x5bc5e2ef, 0x52764e6d, 0xc978527e, 
     0x80dccf4e, 0x7ddf1da3, 0x000ea21d, 0xb9aea3bc, 0x395a59a2, 0xa7ee481a, 0xb4a4ccda, 0xd07df585, 
     0x9fe39474, 0xa68c96b6, 0x4ba19155, 0xfc209ddb, 0xae7f6515, 0x89927e17, 0xe1aef780, 0x690f3100, 
     0xa377f017, 0x9b18b31f, 0xd5b4418c, 0x84038573, 0xfc559b49, 0x6a782bee, 0xc3dcf6e9, 0xfaf5aef6, 
     0x76e10bbe, 0xc34b1be5, 0x888fda49, 0xb91e0289, 0x0d2524c5, 0xb369f8a5, 0x4175f29d, 0xedf8156f, 
     0xff690cf1, 0x86ec7710, 0x4a798315, 0x033bbd27, 0xc8362811, 0xca2d8c46, 0x42c31222, 0xa8e00e73, 
     0x26561c38, 0x4cc56ea9, 0x05bc6477, 0xca205d54, 0x15d2ceb6, 0x198c91d8, 0xb00c7f02, 0x9575400b, 
     0xd3f2621c, 0x7d9ca9b6, 0xa09ea6f7, 0x76968b19, 0xdc3f3e3b, 0x064eac64, 0x729960c5, 0x1a7e543e, 
     0xee830724, 0x813acf42, 0x0368711d, 0x6f65ef7d, 0x05c6a128, 0xfb3a87f1, 0x70b2def1, 0xa1c5f115, 
     0x5f5232d9, 0xc1678952, 0x1661ec72, 0x1d553088, 0x79af1f06, 0x5f19ca87, 0x929f2110, 0x9110c096, 
     0x0ea70cc1, 0xa3ea7ff0, 0xc1d3407d, 0xe92ef742, 0x1e42df5c, 0x9ab31d2e, 0xc0a750a9, 0x522869cb, 
     0xe4cabd66, 0x908d5823, 0xec0494c6, 0x39b7ebb4, 0xddc70ab2, 0x14d026ef, 0xe2139345, 0x4cd593bc, 
     0xc7026c50, 0xf116bdf4, 0x7f3d11d6, 0x76b9b5e5, 0x9f85c791, 0x343890d1, 0xe02b146b, 0xe7dee670, 
     0xa0984105, 0x2c4e5569, 0x62c6df34, 0x09fdfcdd, 0x4ac53f7f, 0x64b201dd, 0xa237f8a3, 0x8b0d0cef, 
     0x58d4650f, 0xabfdc98d, 0x7de72568, 0x584869a5, 0xc7cf9906, 0x0c08211a, 0x107f6a76, 0xa028aa41, 
     0xd5fe00f6, 0xd4ebc065, 0xb8e80cfb, 0xcd65a444, 0xffebfeae, 0x92009a90, 0x134b906a, 0x8ef86b6f, 
     0x015e3940, 0x11dfe3fb, 0xfc10bb74, 0xcf1a54c2, 0xd96196fe, 0x5f631147, 0x91e29209, 0xbd45f47f, 
     0xc33c3977, 0xc9a3da56, 0x2fa95a5b, 0xc5312128, 0x3c78887e, 0xdbf83148, 0x738d99db, 0x95d7f07c, 
     0x02df2822, 0x63fd4c7e, 0x3bf91339, 0x1970b57d, 0x1279fdb6, 0x6e899f9a, 0xa294cd67, 0x7f75056b, 
     0xa8902dca, 0x49b6e17c, 0x06490c95, 0x32a0b5c9, 0x42ac1c2f, 0x81dc0645, 0x053f5535, 0xe1e9db56, 
     0x9c9770f6, 0xe2964257, 0x7ae06df7, 0x7889cc14, 0xb4590e70, 0x7abb0c52, 0x83d559cd, 0x24f91b44, 
     0xc63c1a2e, 0x96641717, 0x7e085fe7, 0x53f2a067, 0x50c8fa01, 0xc3ec59c8, 0x06a003b8, 0xb16e6d3e, 
     0x0ec753fb, 0xcdea07c5, 0xf9070aee, 0x2ba4d9c9, 0xfe41096b, 0xc23796af, 0x75e6797d, 0xef0f784b, 
     0x5c7f42e3, 0xefeebb67, 0xd5269593, 0x68682043, 0xa60b6335, 0xe1666b0f, 0xb7f0e3a4, 0x45a6e573, 
     0x98ad1070, 0x6439db08, 0xf9ad285f, 0x72041ddc, 0x306f2fe7, 0x873f7ff1, 0xb6066ab5, 0x1df95bbe, 
     0xaa99e42a, 0x95930ead, 0x4de4edd9, 0xb240779c, 0x84b5960a, 0x1b8c7b5c, 0x59703639, 0xded28335, 
     0x7a8be798, 0xe8c3fc60, 0xb9120989, 0x8ee6d68b, 0x8a25bf25, 0x07130659, 0x88756eb8, 0xeff705df, 
     0xf1cb4142, 0xc6934e28, 0x2581a7f7, 0x6fbce4b2, 0x2b06d2c0, 0xb29dc9ef, 0x2b5e3ab8, 0xba3088c5, 
     0xf5a019b0, 0x98c9ac0e, 0x7977edac, 0xbe8c4618, 0x4da2f963, 0x84f16c26, 0x2b73c3c3, 0xa647b4ed, 
     0x6f54976b, 0xc42ebd18, 0x9d3d032f, 0xe11ca7c5, 0xd93f5a97, 0xe5d99606, 0x6efc3160, 0x1b023361, 
     0x482de5fa, 0xb48a2a50, 0x791b1208, 0x4234adc2, 0xb8261de3, 0x3d1bef98, 0xdd41ac18, 0x812baa29, 
     0x667428e5, 0xcea59abe, 0xf65842c0, 0x479e0016, 0xd09f6bd0, 0xf48020e3, 0x608a5b71, 0x4188c44b, 
     0xb3708bb5, 0x7c46b669, 0xfa3ebade, 0x5a2149c9, 0x0bf16ce5, 0x72d0d1ef, 0xe01e66f5, 0xc1e227d1, 
     0x166b33f1, 0x25372659, 0x6e13a3ea, 0xe28430e4, 0x506647aa, 0x20d3a9c5, 0x4346f62c, 0x6a007bc2, 
     0x76ab4b21, 0x303e9196, 0x3b20246c, 0x47905c6e, 0x864425a7, 0x6450516c, 0x734a339d, 0xa4ac6927, 
     0xbd79f9cd, 0x0724a029, 0x47ad66ed, 0xf00d766f, 0x97d42d65, 0xa71171ec, 0x567244d0, 0xd8ac9807, 
     0xd21d657e, 0x11b0fa19, 0x7c0291f5, 0x47c325f0, 0x6a5e886b, 0x52dcb04e, 0xd605514d, 0x6cc9b26a, 
     0x9ddfb9bb, 0xb6ac476e, 0xc166cc0a, 0xb37912f7, 0xe72a5d41, 0xcb7ab699, 0xda4d849d, 0xcacb5c59, 
     0x06071a0d, 0x5ede3130, 0xfd233fb6, 0x9cf9e58f, 0xf67fd570, 0x7cb32cd5, 0x49900347, 0x587a40da, 
     0xf5dcb2fb, 0x71105e68, 0x1a7f1380, 0x6a0945bd, 0x7fa7187f, 0xcb4eba0b, 0x0d17f6d3, 0x809e06f8, 
     0x52a7a90d, 0x5708761e, 0xffc370f0, 0x8672da8b, 0x6ae84df6, 0x22150742, 0x0d2a86c9, 0xa9fe56b8, 
     0x05b027cb, 0x798f2258, 0x94367d8f, 0x56fb4d00, 0x9f8b9c5e, 0xe8cebc82, 0x3111dab2, 0x3a63d624, 
     0xf63f53be, 0x3d6c0a20, 0xc12263e4, 0x436e4624, 0x07d72e3d, 0x854280d3, 0x61131c16, 0x9d953143, 
     0x0e9c556d, 0x0c69d57d, 0x6ecd4978, 0xb6926c00, 0x88162b1e, 0x6139fc3e, 0x8579717b, 0x395c0d1d, 
     0x330f5660, 0x4f4c2b78, 0x838058d1, 0x152e689b, 0x0b8ebb86, 0xe47bd8ca, 0x858c036b, 0x768013bb, 
     0x4edf7e20, 0x6cdeb617, 0xe883b879, 0xc90be1fe, 0x798904ff, 0x76cfbb80, 0x4991fa6d, 0xbcc8ea24, 
     0x4855f434, 0xcde71b64, 0x861e90f8, 0x3bf1802f, 0xb84d3110, 0x7ffe4d66, 0xbad37e0a, 0x73fd3a60, 
     0x07b9e124, 0xd82f0567, 0x439908d4, 0xd2a7ed38, 0xb2226842, 0x67d13787, 0xbe99b5c8, 0x03e7ad78, 
     0x75536c79, 0xf77d1a27, 0x083b4a97, 0xf5f7cf20, 0x4d52d11b, 0x960d21e8, 0x3e2aca32, 0xd54ee973, 
     0x796abeba, 0x919a02ac, 0xbe4e7bc8, 0x0ea7cff0, 0x73249625, 0x747db293, 0x23cfe3cd, 0x4ffa9659, 
     0xfa47fe6f, 0x0d4f66fe, 0x4b18c6f0, 0x848094af, 0x0bdfdce8, 0x6ae8938f, 0x53d02923, 0xdab35d33, 
     0xe2335521, 0xd562ee26, 0x99e25196, 0xbf4ac765, 0xfdccceeb, 0xde156ce4, 0xb875c3bb, 0xdf40e608, 
     0x1874eb57, 0x509b412b, 0x8ef34442, 0x27cd0f1b, 0x313391b6, 0x39cde49b, 0x3906d91d, 0xc46ad8e0, 
     0x8452e799, 0xe6c40815, 0x1495c87d, 0x24d015d8, 0x8e5c50d1, 0xe4d8a3ba, 0xbdca95d2, 0xf3f9dbc3, 
     0x0e17716f, 0xffa3eaec, 0x120e05cd, 0x1e1d80a4, 0xfe8e31c5, 0x45fe524c, 0x2e0a1d61, 0xd2b599ba, 
     0x9e09b362, 0x030290b9, 0x6fa722bd, 0x7d7af987, 0x69125c18, 0xc6079956, 0x730e9952, 0xcb65b7cc, 
     0x1c72d2f9, 0x5aa7a184, 0x15a847d2, 0xa9b0288a, 0xb531fa55, 0xceba1fe2, 0x741e322e, 0x44d3e002}};

static unsigned sha2_raw_outputs[N_TESTS][8] = {
    {0xd14a028c, 0x2a3a2bc9, 0x476102bb, 0x288234c4, 0x15a2b01f, 0x828ea62a, 0xc5b3e42f, 0x0}, // 0, SHA224ShortMsg.rsp
    {0x3cd36921, 0xdf5d6963, 0xe73739cf, 0x4d20211e, 0x2d8877c1, 0x9cff087a, 0xde9d0e3a, 0x0},
    {0xdaff9bce, 0x685eb831, 0xf97fc122, 0x5b03c275, 0xa6c112e2, 0xd6e76f5f, 0xaf7a36e6, 0x0},
    {0x2c895902, 0x3515476e, 0x38388abb, 0x43599a29, 0x876b4b33, 0xd56adc06, 0x032de3a2, 0x0},
    {0xae57c0a6, 0xd49739ba, 0x338adfa5, 0x3bdae063, 0xe5c09122, 0xb7760478, 0x0a8eeaa3, 0x0},
    {0x7f631f29, 0x5e024e74, 0x55208324, 0x5ca8f988, 0xa3fb6568, 0x0ae97c30, 0x40d2e65c, 0x0},
    {0x342e8e6b, 0x23c1c6a5, 0x4910631f, 0x098e08e8, 0x36259c57, 0xe49c1b1d, 0x023d166d, 0x0},
    {0x3aa702b1, 0xb66dc57d, 0x7aec3ccd, 0xbdfbd885, 0x92d7520f, 0x843ba5d0, 0xfa481168, 0x0},
    {0xbdf21ff3, 0x25f75415, 0x7ccf417f, 0x4855360a, 0x72e8fd11, 0x7d28c8fe, 0x7da3ea38, 0x0},
    {0x03842600, 0xc86f5cd6, 0x0c3a2147, 0xa067cb96, 0x2a05303c, 0x3488b05c, 0xb45327bd, 0x0}, // 72, SHA224ShortMsg.rsp
    {0xb2a5586d, 0x9cbf0baa, 0x999157b4, 0xaf06d88a, 0xe08d7c9f, 0xaab4bc1a, 0x96829d65, 0x0}, // 512, SHA224ShortMsg.rsp
    {0x45ae4c1a, 0xa7ab5c5e, 0xb3ef6ed9, 0xbcd706fc, 0xfebf72bd, 0xb5f8f327, 0xe1f0bc02, 0x0}}; // 51200, SHA224LongMsg.rsp

//static void sha2_init_buf (unsigned idx, token_t *mem, token_t *gold_outputs)
//{
//    int j;
//
////    printf("  mem @%p\n", mem);
////
////    printf("  sha2_in_bytes %u\n", sha2_in_bytes);
////    printf("  sha2_out_bytes %u\n", sha2_out_bytes);
////
////    printf("  sha2_raw_in_words %u\n", sha2_raw_in_words[idx]);
////    printf("  sha2_raw_out_words %u\n", sha2_raw_out_words[idx]);
//
//    for (j = 0; j < sha2_raw_in_words[idx]; j++)
//    {
//        mem[j] = sha2_raw_inputs[idx][j];
//#ifdef __DEBUG__
//        printf("  sha2_raw_inputs[%u][%u] %x\n", idx, j, sha2_raw_inputs[idx][j]);
//#endif
//    }
//
//    printf("  gold output data @%p\n", gold_outputs);
//
//    for (j = 0; j < sha2_raw_out_words[idx]; j++) {
//        gold_outputs[j] = sha2_raw_outputs[idx][j];
//#ifdef __DEBUG__
//        printf("  raw_outputs[%u][%u] %x\n", idx, j, raw_outputs[idx][j]);
//#endif
//    }
//}

static void sha2_init_buf(unsigned idx, token_t *mem, token_t *gold_outputs, unsigned *raw_in_words, unsigned *raw_out_words, unsigned raw_inputs[][1600], unsigned raw_outputs[][8])
{
    int j;

    printf("INFO: mem @%p\n", mem);
    printf("INFO: raw_in_words[%u] %u\n", idx, raw_in_words[idx]);
    printf("INFO: raw_out_words[%u] %u\n", idx, raw_out_words[idx]);

    for (j = 0; j < raw_in_words[idx]; j++)
    {
        mem[j] = raw_inputs[idx][j];
#ifdef __DEBUG__
        printf("INFO: raw_inputs[%u][%u] %x\n", idx, j, raw_inputs[idx][j]);
#endif
    }

#ifdef __DEBUG__
    printf("INFO: gold output data @%p\n", gold_outputs);
#endif

    for (j = 0; j < raw_out_words[idx]; j++) {
        gold_outputs[j] = raw_outputs[idx][j];
#ifdef __DEBUG__
        printf("INFO: raw_outputs[%u][%u] %x\n", idx, j, raw_outputs[idx][j]);
#endif
    }
}


#endif
